package com.tron.dobest.rabbitmq;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class RabbitCondition implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        if ("true".equalsIgnoreCase(conditionContext.getEnvironment().getProperty("useRabbit"))) {
            return true;
        }
        return false;
    }
}
